
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Java 内存管理 -- 父子实例的内存控制 · 寒江蓑笠的博客</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="介绍 java 构造方法的初始化顺序">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="java-basic-memory-manage-inherit-object.html" />
    
    
    <link rel="prev" href="java-basic-final.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="java-basic-joor.html">
            
                <a href="java-basic-joor.html">
            
                    
                    Java 基础 -- 使用 JOOR 实现反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="java-basic-annotation.html">
            
                <a href="java-basic-annotation.html">
            
                    
                    Java基础 -- 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="java-basic-threadlocal.html">
            
                <a href="java-basic-threadlocal.html">
            
                    
                    Java 基础 -- ThreadLocal
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="java-development-skills-get-stacktrace.html">
            
                <a href="java-development-skills-get-stacktrace.html">
            
                    
                    Java 开发技巧 -- 获取 Java 的调用栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="java-basic-concurrent-map-collection.html">
            
                <a href="java-basic-concurrent-map-collection.html">
            
                    
                    Java 基础 -- 并发集合的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="java-dynamic-proxy-invocationhandler-demo.html">
            
                <a href="java-dynamic-proxy-invocationhandler-demo.html">
            
                    
                    Java InvocationHandler 实现动态代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="java-basic-try-catch-finally.html">
            
                <a href="java-basic-try-catch-finally.html">
            
                    
                    Java 基础 -- 深入理解 try catch finally
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="java-basic-reflect.html">
            
                <a href="java-basic-reflect.html">
            
                    
                    Java 基础 -- 反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="java-basic-io-stream.html">
            
                <a href="java-basic-io-stream.html">
            
                    
                    Java IO -- IO流的概念和分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="java-basic-final.html">
            
                <a href="java-basic-final.html">
            
                    
                    Java 基础 -- 深入理解 final 修饰符
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.11" data-path="java-basic-memory-manage-constructor.html">
            
                <a href="java-basic-memory-manage-constructor.html">
            
                    
                    Java 内存管理 -- 父子实例的内存控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.12" data-path="java-basic-memory-manage-inherit-object.html">
            
                <a href="java-basic-memory-manage-inherit-object.html">
            
                    
                    Java 内存管理 -- 构造方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.13" data-path="java-basic-memory-manage-memory-area.html">
            
                <a href="java-basic-memory-manage-memory-area.html">
            
                    
                    Java 内存管理 -- 内存区域的划分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.14" data-path="java-basic-memory-manage-variable.html">
            
                <a href="java-basic-memory-manage-variable.html">
            
                    
                    Java 内存管理 -- 变量的内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.15" data-path="java-basic-knowledge-generic.html">
            
                <a href="java-basic-knowledge-generic.html">
            
                    
                    Java 基础 -- 范型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.16" data-path="java-basic-knowledge-auto-boxing.html">
            
                <a href="java-basic-knowledge-auto-boxing.html">
            
                    
                    Java 基础 -- 关于自动装箱和拆箱机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.17" data-path="java-basic-knowledge-parameter-passing.html">
            
                <a href="java-basic-knowledge-parameter-passing.html">
            
                    
                    Java 基础 -- 值传递、引用传递和参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.18" data-path="java-basic-stringbuilder-stringbuffer.html">
            
                <a href="java-basic-stringbuilder-stringbuffer.html">
            
                    
                    Java 基础 -- StringBuilder 和 StringBuffer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.19" data-path="java-basic-knowledge-about-string.html">
            
                <a href="java-basic-knowledge-about-string.html">
            
                    
                    Java 基础 -- 深入理解 String
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.20" data-path="java-basic-linkedhashmap.html">
            
                <a href="java-basic-linkedhashmap.html">
            
                    
                    Java 基础 -- LinkedHashMap 的使用和原理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Java 内存管理 -- 父子实例的内存控制</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x6982;&#x8FF0;">&#x6982;&#x8FF0;</h2>
<p>&#x672C;&#x8282;&#x5C06;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x5728;&#x5BF9;&#x8C61;&#x521D;&#x59CB;&#x5316;&#x65F6;&#x7684;&#x6267;&#x884C;&#x987A;&#x5E8F;</p>
<h2 id="&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x8C03;&#x7528;">&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x8C03;&#x7528;</h2>
<p>&#x5F53;&#x521B;&#x5EFA;&#x4EFB;&#x4F55;Java&#x5BF9;&#x8C61;&#x65F6;&#xFF0C;&#x7A0B;&#x5E8F;&#x603B;&#x662F;&#x5148;&#x4F9D;&#x6B21;&#x8C03;&#x7528;&#x6BCF;&#x4E2A;&#x7236;&#x7C7B;&#x7684;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#x3001;&#x7236;&#x7C7B;&#x6784;&#x9020;&#x5668;&#xFF08;&#x603B;&#x662F;&#x4ECE;Object&#x5F00;&#x59CB;&#xFF09;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x6700;&#x540E;&#x624D;&#x8C03;&#x7528;&#x672C;&#x7C7B;&#x7684;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#x3001;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;&#x3002;
&#x5BF9;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#x7684;&#x8C03;&#x7528;&#xFF0C;&#x63A5;&#x7740;&#x4F1A;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x8FD9;&#x4E2A;&#x8C03;&#x7528;&#x5373;&#x53EF;&#x4EE5;&#x662F;&#x901A;&#x8FC7;super&#x8FDB;&#x884C;&#x663E;&#x793A;&#x8C03;&#x7528;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x662F;&#x9690;&#x5F0F;&#x8C03;&#x7528;&#x3002;
&#x5F53;&#x6240;&#x6709;&#x7684;&#x7236;&#x7C7B;&#x7684;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#x3001;&#x6784;&#x9020;&#x5668;&#x4F9D;&#x6B21;&#x8C03;&#x7528;&#x5B8C;&#x6210;&#x540E;&#xFF0C;&#x7CFB;&#x7EDF;&#x8C03;&#x7528;&#x672C;&#x7C7B;&#x7684;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#x3001;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x6700;&#x540E;&#x8FD4;&#x56DE;&#x672C;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x3002;
&#x770B;&#x4E0B;&#x4E00;&#x6BB5;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>public class Food {
    {
        Log.e(&quot;Test&quot;,&quot;Food code block&quot;);
    }
    public Food() {
        Log.e(&quot;Test&quot;,&quot;Food constructor&quot;);
    }
}

public class Fruit extends Food{
    {
        Log.e(&quot;Test&quot;,&quot;Fruit code block&quot;);
    }
    public Fruit() {
        Log.e(&quot;Test&quot;,&quot;Fruit constructor&quot;);
    }
}

public class Apple extends Fruit {
    {
        Log.e(&quot;Test&quot;,&quot;Apple code block&quot;);
    }
    public Apple() {
        Log.e(&quot;Test&quot;,&quot;Apple constructor&quot;);
    }
}
</code></pre><p>&#x6D4B;&#x8BD5;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>Apple apple = new Apple();
</code></pre><p>&#x8FD9;&#x91CC;&#x5BF9;&#x7236;&#x7C7B;&#x6784;&#x9020;&#x5668;&#x7684;&#x8C03;&#x7528;&#x4E3A;&#x9690;&#x5F0F;&#x8C03;&#x7528;&#x3002;
&#x6267;&#x884C;&#x6B65;&#x9AA4;&#xFF1A;</p>
<p> 1.&#x6267;&#x884C;Object&#x7C7B;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#xFF08;&#x5982;&#x679C;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x3002;
 2.&#x9690;&#x5F0F;&#x6216;&#x663E;&#x793A;&#x8C03;&#x7528;Object&#x7C7B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;
 3.&#x6267;&#x884C;Food&#x7C7B;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#xFF08;&#x5982;&#x679C;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x3002;
 4.&#x9690;&#x5F0F;&#x6216;&#x663E;&#x793A;&#x8C03;&#x7528;Food&#x7C7B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;
 5.&#x6267;&#x884C;Fruit&#x7C7B;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#xFF08;&#x5982;&#x679C;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x3002;
 6.&#x9690;&#x5F0F;&#x6216;&#x663E;&#x793A;&#x8C03;&#x7528;Fruit&#x7C7B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;
 7.&#x6267;&#x884C;Apple&#x7C7B;&#x975E;&#x9759;&#x6001;&#x521D;&#x59CB;&#x5316;&#x5757;&#xFF08;&#x5982;&#x679C;&#x6709;&#x7684;&#x8BDD;&#xFF09;&#x3002;
 8.&#x9690;&#x5F0F;&#x6216;&#x663E;&#x793A;&#x8C03;&#x7528;Apple&#x7C7B;&#x7684;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;</p>
<p>&#x6267;&#x884C;&#x7ED3;&#x679C;&#xFF1A;</p>
<pre><code>E Test    : Food code block
E Test    : Food constructor
E Test    : Fruit code block
E Test    : Fruit constructor
E Test    : Apple code block
E Test    : Apple constructor
</code></pre><p>&#x53EA;&#x8981;&#x5728;&#x7A0B;&#x5E8F;&#x4E2D;&#x521B;&#x5EFA;Java&#x5BF9;&#x8C61;&#xFF0C;&#x7CFB;&#x7EDF;&#x603B;&#x662F;&#x5148;&#x8C03;&#x7528;&#x6700;&#x9876;&#x5C42;&#x7236;&#x7C7B;&#x7684;&#x521D;&#x59CB;&#x5316;&#x64CD;&#x4F5C;&#xFF0C;&#x5305;&#x62EC;&#x521D;&#x59CB;&#x5316;&#x5757;&#x548C;&#x6784;&#x9020;&#x5668;&#xFF0C;&#x7136;&#x540E;&#x4F9D;&#x6B21;&#x5411;&#x4E0B;&#x8C03;&#x7528;&#x6240;&#x6709;&#x7236;&#x7C7B;&#x7684;&#x521D;&#x59CB;&#x5316;&#x64CD;&#x4F5C;&#xFF0C;&#x6700;&#x7EC8;&#x6267;&#x884C;&#x672C;&#x7C7B;&#x7684;&#x521D;&#x59CB;&#x5316;&#x64CD;&#x4F5C;&#x8FD4;&#x56DE;&#x672C;&#x7C7B;&#x7684;&#x5B9E;&#x4F8B;&#x3002;
&#x81F3;&#x4E8E;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x90A3;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x5206;&#x4E3A;&#x4E0B;&#x9762;&#x51E0;&#x4E2D;&#x60C5;&#x51B5;&#xFF1A;</p>
<ul>
<li>&#x5B50;&#x7C7B;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x4F53;&#x7684;&#x7B2C;&#x4E00;&#x884C;&#x4EE3;&#x7801;&#x4F7F;&#x7528;super&#x663E;&#x793A;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x6784;&#x9020;&#x5668;&#xFF0C;&#x7CFB;&#x7EDF;&#x5C06;&#x6839;&#x636E;super&#x8C03;&#x7528;&#x91CC;&#x4F20;&#x5165;&#x7684;&#x5B9E;&#x53C2;&#x5217;&#x8868;&#x6765;&#x786E;&#x5B9A;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x54EA;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x3002;</li>
<li>&#x5B50;&#x7C7B;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x4F53;&#x7684;&#x7B2C;&#x4E00;&#x884C;&#x4EE3;&#x7801;&#x4F7F;&#x7528;this&#x663E;&#x793A;&#x8C03;&#x7528;&#x672C;&#x7C7B;&#x4E2D;&#x91CD;&#x8F7D;&#x7684;&#x6784;&#x9020;&#x5668;&#xFF0C;&#x7CFB;&#x7EDF;&#x5C06;&#x6839;&#x636E;this&#x8C03;&#x7528;&#x91CC;&#x4F20;&#x5165;&#x7684;&#x5B9E;&#x53C2;&#x5217;&#x8868;&#x6765;&#x786E;&#x5B9A;&#x672C;&#x7C7B;&#x7684;&#x53E6;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x5668;&#xFF08;&#x6267;&#x884C;&#x672C;&#x7C7B;&#x4E2D;&#x53E6;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x5668;&#x65F6;&#x5373;&#x8FDB;&#x5165;&#x7B2C;&#x4E00;&#x79CD;&#x60C5;&#x51B5;&#xFF09;&#x3002;</li>
<li>&#x5B50;&#x7C7B;&#x6784;&#x9020;&#x5668;&#x6267;&#x884C;&#x4F53;&#x4E2D;&#x65E2;&#x6CA1;&#x6709;super&#x8C03;&#x7528;&#xFF0C;&#x4E5F;&#x6CA1;&#x6709;this&#x8C03;&#x7528;&#xFF0C;&#x7CFB;&#x7EDF;&#x5C06;&#x4F1A;&#x5728;&#x6267;&#x884C;&#x5B50;&#x7C7B;&#x6784;&#x9020;&#x5668;&#x4E4B;&#x524D;&#xFF0C;&#x9690;&#x5F0F;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x65E0;&#x53C2;&#x6570;&#x7684;&#x6784;&#x9020;&#x5668;&#x3002;</li>
</ul>
<p><strong>&#x6CE8;&#x610F;</strong>&#xFF1A;super&#x8C03;&#x7528;&#x7528;&#x4E8E;&#x663E;&#x793A;&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x6784;&#x9020;&#x5668;&#xFF0C;this&#x8C03;&#x7528;&#x7528;&#x4E8E;&#x663E;&#x5F0F;&#x8C03;&#x7528;&#x672C;&#x7C7B;&#x4E2D;&#x53E6;&#x4E00;&#x4E2A;&#x91CD;&#x8F7D;&#x7684;&#x6784;&#x9020;&#x5668;&#x3002;super&#x548C;this&#x90FD;&#x53EA;&#x80FD;&#x5728;&#x6784;&#x9020;&#x5668;&#x4E2D;&#x4F7F;&#x7528;&#xFF0C;&#x800C;&#x4E14;super&#x548C;this&#x90FD;&#x5FC5;&#x987B;&#x4F5C;&#x4E3A;&#x6784;&#x9020;&#x5668;&#x7684;&#x7B2C;&#x4E00;&#x884C;&#x4EE3;&#x7801;&#xFF0C;&#x5426;&#x5219;&#x7F16;&#x8BD1;&#x5668;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x901A;&#x8FC7;super&#x8C03;&#x7528;&#x7236;&#x7C7B;&#x7684;&#x666E;&#x901A;&#x65B9;&#x6CD5;&#x5219;&#x6CA1;&#x6709;&#x9650;&#x5236;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x6784;&#x9020;&#x5668;&#x4E2D;&#x7684;super&#x548C;this&#x8C03;&#x7528;&#x6700;&#x591A;&#x53EA;&#x80FD;&#x4F7F;&#x7528;&#x5176;&#x4E2D;&#x4E4B;&#x4E00;&#xFF0C;&#x800C;&#x4E14;&#x6700;&#x591A;&#x53EA;&#x80FD;&#x8C03;&#x7528;&#x4E00;&#x6B21;&#x3002;</p>
<h2 id="&#x5E38;&#x89C1;&#x95EE;&#x9898;">&#x5E38;&#x89C1;&#x95EE;&#x9898;</h2>
<p>&#x5173;&#x4E8E;&#x6784;&#x9020;&#x51FD;&#x6570;&#x7684;&#x521D;&#x59CB;&#x5316;&#x987A;&#x5E8F;&#x6211;&#x4EEC;&#x505A;&#x4E0B;&#x9762;&#x7684;&#x6D4B;&#x8BD5;&#xFF1A;</p>
<pre><code>abstract public class Fruit{
    public Fruit() {
        super();
        Log.e(&quot;Test&quot;,&quot;Fruit constructor&quot;);
        setName();
    }

    protected String name;
    abstract public void setName();
    public String getName() {
        return name;
    }
}

public class Apple extends Fruit {
    public Apple() {
        super();
        Log.e(&quot;Test&quot;,&quot;Apple constructor&quot;);
    }

    String n = &quot;Apple&quot;;
    @Override
    public void setName() {
        name = n;
    }
}
</code></pre><p>&#x8C03;&#x7528;&#x4E0B;&#x9762;&#x4EE3;&#x7801;&#xFF1A;</p>
<pre><code>        Apple apple = new  Apple();
        Log.e(&quot;Test&quot;,&quot;name = &quot;+apple.getName());
</code></pre><p>&#x53D1;&#x73B0;&#x6253;&#x5370; name &#x4E3A;null&#x3002;
&#x56E0;&#x6B64;&#x62BD;&#x8C61;&#x7236;&#x7C7B;&#x6784;&#x9020;&#x51FD;&#x6570;&#x8C03;&#x7528;&#x62BD;&#x8C61;&#x65B9;&#x6CD5; setName &#x65F6;&#xFF0C;&#x8C03;&#x7528;&#x7684;&#x662F;&#x5B50;&#x7C7B; Apple &#x7684; setName &#x65B9;&#x6CD5;&#xFF0C;&#x6B64;&#x65F6;&#x5B50;&#x7C7B;&#x7684;&#x53D8;&#x91CF; n &#x8FD8;&#x6CA1;&#x6709;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x56E0;&#x6B64; name &#x4E3A; null&#x3002;</p>
<h2 id="&#x53C2;&#x8003;">&#x53C2;&#x8003;</h2>
<p>&#x300A;&#x6DF1;&#x5165;&#x7406;&#x89E3; Java &#x865A;&#x62DF;&#x673A;&#x300B;
&#x300A;&#x75AF;&#x72C2;Java-&#x7A81;&#x7834;&#x7A0B;&#x5E8F;&#x5458;&#x57FA;&#x672C;&#x529F;&#x7684;16&#x8BFE;&#x300B;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="java-basic-final.html" class="navigation navigation-prev " aria-label="Previous page: Java 基础 -- 深入理解 final 修饰符">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="java-basic-memory-manage-inherit-object.html" class="navigation navigation-next " aria-label="Next page: Java 内存管理 -- 构造方法">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Java 内存管理 -- 父子实例的内存控制","categories":"Java","comments":true,"tags":["Java"],"description":"介绍 java 构造方法的初始化顺序","date":"2014-02-20T10:00:00.000Z","level":"1.1.11","depth":2,"next":{"title":"Java 内存管理 -- 构造方法","level":"1.1.12","depth":2,"path":"source/Java/java-basic-memory-manage-inherit-object.md","ref":"source/Java/java-basic-memory-manage-inherit-object.md","articles":[]},"previous":{"title":"Java 基础 -- 深入理解 final 修饰符","level":"1.1.10","depth":2,"path":"source/Java/java-basic-final.md","ref":"source/Java/java-basic-final.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"寒江蓑笠的博客","gitbook":"*"},"file":{"path":"source/Java/java-basic-memory-manage-constructor.md","mtime":"2022-05-17T10:49:59.387Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-05-17T10:54:58.084Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

